-- @owner:宋菲
-- @date:2024-03-15
-- @testpoint:1.测试删除函数，函数名称大小写不敏感，合理报错

--开启参数
set enable_ignore_case_in_dquotes to on;

--创建表和函数;expect:成功(9 rows)
create table t_ignore_case_in_dquotes_drop_case0019(col1 int,col2 int); 

create function f_ignore_case_in_dquotes_drop_case0019_1("Col" int) returns int
as $$
begin
    insert into t_ignore_case_in_dquotes_drop_case0019 values(1,1);
    return col;
end;
$$language plpgsql;
/

create function f_ignore_case_in_dquotes_drop_case0019_2("Col" int) returns int
as $$
begin
    insert into t_ignore_case_in_dquotes_drop_case0019 values(2,2);
    return col;
end;
$$language plpgsql;
/

create function f_ignore_case_in_dquotes_drop_case0019_3("Col" int) returns int
as $$
begin
    insert into t_ignore_case_in_dquotes_drop_case0019 values(3,3);
    return col;
end;
$$language plpgsql;
/

create function "f_ignore_case_in_dquotes_drop_case0019_!@#$%^&*()?<>:;=+-_4"("Col" int) returns int
as $$
begin
    insert into t_ignore_case_in_dquotes_drop_case0019 values(4,4);
    return col;
end;
$$language plpgsql;
/

create function "f_ignore_case_in_dquotes_drop_case0019_'''_5"("Col" int) returns int
as $$
begin
    insert into t_ignore_case_in_dquotes_drop_case0019 values(5,5);
    return col;
end;
$$language plpgsql;
/

create function "f_ignore_case_in_dquotes_drop_case0019_""""""_6"("Col" int) returns int
as $$
begin
    insert into t_ignore_case_in_dquotes_drop_case0019 values(6,6);
    return col;
end;
$$language plpgsql;
/

create function "f_ignore_case_in_dquotes_drop_case0019_''""_7"("Col" int) returns int
as $$
begin
    insert into t_ignore_case_in_dquotes_drop_case0019 values(7,7);
    return col;
end;
$$language plpgsql;
/

create function f_ignore_case_in_dquotes_drop_case0019_8("Col" int) returns int
as $$
begin
    insert into t_ignore_case_in_dquotes_drop_case0019 values(8,8);
    return col;
end;
$$language plpgsql;
/

--step1:删除函数名为全小写;expect:成功 
drop function "f_ignore_case_in_dquotes_drop_case0019_1";

--step2:删除函数名为全大写;expect:成功
drop function "F_IGNORE_CASE_IN_DQUOTES_DROP_CASE0019_2";

--step3:删除函数名为大小写混合;expect:成功
drop function "f_IgNOrE_CasE_IN_dquotes_drop_cASe0019_3";

--step4:删除函数名带有特殊符号;expect:成功
drop function "f_IGNORE_CASE_IN_dquotes_drop_CASE0019_!@#$%^&*()?<>:;=+-_4";

--step5:删除函数名带有单引号;expect:成功
drop function "f_IGNORE_CASE_IN_dquotes_drop_CASE0019_'''_5";


--step6:删除函数名带有双引号;expect:成功
drop function "f_IGNORE_CASE_IN_dquotes_drop_CASE0019_""""""_6";

--step7:删除函数名带有单引号、双引号混合;expect:成功
drop function "F_IGNORE_CASE_IN_dquotes_drop_case0019_''""_7";

--step8:异常情况，删除已经存在的小写对象名的对象;expect:报错ERROR: does not exists
drop function f_ignore_case_in_dquotes_drop_case0019_8;

drop function "F_IGNORE_CASE_IN_DQUOTES_DROP_CASE0019_8";

--清理环境:expect:成功
drop table t_ignore_case_in_dquotes_drop_case0019;

--关闭参数
set enable_ignore_case_in_dquotes to off;
